#!/usr/bin/env python

# Computers make calculations. They excel at it.
# In programming, the word for calculationis operation.
# There are many "operators" that you can use to manipulate values.

# The basic operators include all of the standard arithmetic operators
#    with which you are already familiar.

# Addition:
print "Addition"
print 10 + 10
print 1.5 + 2
print -3 + 3.14
print
# Subtraction:
print "Subtraction"
print 10 - 10
print 1.5 - 2
print -3 - 3.14
print
# Multiplication:
print "Multiplication"
print 10 * 10
print 1.5 * 2
print -3 * 3.14
print
# Division:
print """Division:
Somthing funny is happening here. What is it?"""
print 10 / 10
print 3 / 2
print 1 / 2
print 1.5 / 2
print -3 / 3.14
print

# Modulo:
print """Modulo Division:
What does this do?"""
print 10 % 10
print 10 % 9
print 10 % 8
print 10 % 7
print 10 % 6
print 10 % 5
print 10 % 4
print 10 % 3
print 10 % 2
print 10 % 1

# You can use literal values, variables or a combination in any operation.
print "Using variables and literals:"
numberOfHotdogs = 23
numberOfHamburgers = 13
numberOfPeople = 62

# Results of operations can be assigned to variables.
totalMeat = numberOfHotdogs + numberOfHamburgers
totalMeatPerPerson = totalMeat / numberOfPeople



daysOfHamburgers = numberOfHamburgers 

# If you divide an integer by and integer, the result will be an integer
print "This is wrong:", totalMeat,"/",numberOfPeople,"=", totalMeatPerPerson
print "type(totalMeatPerPerson) == ",type(totalMeatPerPerson)
# Use the 'float' function to convert an integer to a float to get unrounded result
totalMeatPerPerson = float(totalMeat) / numberOfPeople
print "This is right:", totalMeat,"/",numberOfPeople,"=", totalMeatPerPerson
print "type(totalMeatPerPerson) == ", type(totalMeatPerPerson)


# Order of Operations
# What is the order of operations?
# Hint: You already know.
# Another Hint: Parentheses force earlier evaluation.
print 1.0 + 2.0 * 3.0 / 4.0 - 5.0
print 5.0 - 4.0 + 3.0 * 2.0 / 1.0
print 1.0 + 2.0 * 3.0 / (4.0 - 5.0)
print 5.0 - (4.0 + 3.0) * 2.0 / 1.0
print



#Yes, you can do multiple operations.
hamburgersPerDay = 4
numberOfDays = 4
hamburgerSurplus = numberOfHamburgers - hamburgersPerDay * numberOfDays
print "Total Hamburgers: ", numberOfHamburgers
print "Hamburgers eaten per day: ", hamburgersPerDay
print "Number of days spent eating hamburgers: ", numberOfDays
print "Hamburger Surplus: ",hamburgerSurplus
print "There aren't enough hamburgers!!!!"
